package gdou.gym.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class SiteApplication {
    private Integer id;

    private Integer spaceId;

    //0 刚申请(申请中)1已同意，2拒接
    private Integer status;
    private String applicant;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date timestamp;
    private String site;
    private String date;
    private String time;
    private String reason;
    private String reviewer;


    public String getSite() {
        return site;
    }

    public void setSite(String site) {
        this.site = site == null ? null : site.trim();
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date == null ? null : date.trim();
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time == null ? null : time.trim();
    }


    public Integer getId() {
        return id;
    }


    public String getApplicant() {
        return applicant;
    }

    public void setApplicant(String applicant) {
        this.applicant = applicant == null ? null : applicant.trim();
    }

    public Integer getSpaceId() {
        return spaceId;
    }

    public void setSpaceId(Integer spaceId) {
        this.spaceId = spaceId;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason == null ? null : reason.trim();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getReviewer() {
        return reviewer;
    }

    @Override
    public String toString() {
        return "SiteApplication{" +
                "id=" + id +
                ", spaceId=" + spaceId +
                ", status=" + status +
                ", applicant='" + applicant + '\'' +
                ", timestamp=" + timestamp +
                ", site='" + site + '\'' +
                ", date='" + date + '\'' +
                ", time='" + time + '\'' +
                ", reason='" + reason + '\'' +
                ", reviewer='" + reviewer + '\'' +
                '}';
    }

    public void update(SpaceView view) {
        site = view.getSite();
        date = view.getData();
        time = view.getTime();
    }


    public void setReviewer(String reviewer) {
        this.reviewer = reviewer == null ? null : reviewer.trim();
    }
}